package com.situ.ymall.controller.api;

import com.situ.ymall.entity.Goods;
import com.situ.ymall.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/goods")
public class APIGoodsController {
    @Autowired
    private GoodsService goodsService;

    @GetMapping("/search")
    public List search(Goods goods,Integer firstSortId){
        // 1. 获取参数
        // 2. 调用service层
        List list = goodsService.search(goods,firstSortId);
        // 3. 返回数据
        return list;
    }
}
